<%@page contentType="text/html; charset=UTF-8"%>
<%@page pageEncoding="UTF-8"%>
<%@page import="java.util.*" %>


<%@page import="orest.common.util.Tools"%>
<%@page import="orest.common.valueobject.NeedForExpertVal"%>
<%@page import="orest.common.valueobject.*"%>

<%@page import="orest.common.dao.NeedForExpertDao"%>
<%
//这两个类没有
//rest.action.front.CorrelativePolicyAction,rest.action.front.IndustryDynamicAction
 %>

<%@page import="orest.common.util.IDGenerator"%>

<%
    //request.setCharacterEncoding("gbk");
    String path = request.getContextPath();
    Tools tool = new Tools();
    boolean  results = false;
    NeedForExpertVal obj = null; 
    
    NeedForExpertDao action = new NeedForExpertDao();
    String expertneededfield = request.getParameter("expertneededfield")==null?"":request.getParameter("expertneededfield");    
    String province = request.getParameter("province")==null?"":request.getParameter("province");    
    String unitname = request.getParameter("unitname")==null?"":request.getParameter("unitname");
    String unitfield = request.getParameter("unitfield")==null?"":request.getParameter("unitfield");
    String addr = request.getParameter("addr")==null?"":request.getParameter("addr");
    String linkman = request.getParameter("linkman")==null?"":request.getParameter("linkman");
    String zip = request.getParameter("zip")==null?"":request.getParameter("zip");
    String tel = request.getParameter("tel")==null?"":request.getParameter("tel");
    String fax = request.getParameter("fax")==null?"":request.getParameter("fax");
    String email = request.getParameter("email")==null?"":request.getParameter("email");     
    String detaileddescription = request.getParameter("detaileddescription")==null?"":request.getParameter("detaileddescription");     
    String Id = (String)IDGenerator.getIDGenerator("T_NeedForExpert").getID(2);
   
    obj = new NeedForExpertVal(Id,expertneededfield ,province, unitname, unitfield, addr,linkman,zip,tel,fax,email,detaileddescription,"","0");
    results = action.addNeedForExpert(obj);
    if(results==true){%>
    	<script language="javascript">
	    	alert("您的专家需求已成功提交，我们在找到合适的专家后会根据您留下的联系方式和您联系!");
	    	location.href="<%=path%>/common/indexSearch.jsp?searchtype=2_all";
    	</script>
		<%}else{%>
    	<script language="javascript">
   			alert("对不起，您的需求未能成功提交，请稍候再试!");
   			location.href="<%=path%>/common/indexSearch.jsp?searchtype=2_all";
    	</script>
  <%}%>
